#!/bin/bash
#pMusic - frontend
#GPL - Copyright Sigmund Berglund

export TEXTDOMAIN=pmusic
export OUTPUT_CHARSET=UTF-8
. $APPDIR/gui_misc

#geometry
WINDOW_HEIGHT=`xwininfo -root | grep -m 1 '\geometry' | cut -f4 -d ' ' | cut -f2 -d 'x' | cut -f1 -d '+'`
WINDOW_WIDTH=`xwininfo -root | grep -m 1 '\geometry' | cut -f4 -d ' ' | cut -f1 -d 'x'`

GUI='
<window title="pMusic" icon-name="gtk-media-stop" default_height="'$WINDOW_HEIGHT'" default_width="'$WINDOW_WIDTH'" decorated="false" resizeable="false">
 <vbox space-expand="true" space-fill="true">
  <hbox>
   <vbox space-expand="false" space-fill="false">
    <text height-request="20"><label>""</label></text>
    <button can-focus="no" tooltip-text="'$(gettext 'Leave fullscreen')'">
     <input file stock="gtk-leave-fullscreen"></input>
     <action>exec pmusic</action>
    </button>
   </vbox>
   <text width-request="20"><label>""</label></text>
  </hbox>
 <vbox>
   <hbox homogeneous="true">
    <vbox space-expand="false" space-fill="false">
     <pixmap>
      <variable>ARTWORK</variable>
      <height>400</height>
      <input file>'$HOME'/.pmusic/nowplaying_albumart.jpg</input>
     </pixmap>
     <text height-request="25">
      <variable>SVG_NOWPLAYING</variable>
      <input>cut -d"|" -f1 '$HOME'/.pmusic/nowplaying</input>
     </text>
     '$GUI_PROGRESS'
    </vbox>
   </hbox>
 </vbox>
 </vbox>
</window>'
